﻿using System;

namespace CSharp_1209.Generic
{
    public class GeneralList<T> where T : Employee
    {
        private T[] name = new T[3];
        private int counter = 0;
        
        public void Add(T val)
        {
            name[counter] = val;
            counter++;
        }
        
        public void Display()
        {
            for(int i=0;i<counter;i++)
            {
                Console.WriteLine(name[i].Name + " , " + name[i].ID);
            }
        }
        
        public static void Test()
        {
            GeneralList<Employee> objList = new GeneralList<Employee>();
            objList.Add(new Employee("John",100));
            objList.Add(new Employee("James",200));
            objList.Add(new Employee("Patrich",300));
            objList.Display();
        }

    }
}
